/*
 * © Copyright 2011 Romain Marteau, Matthieu Totet
 * 
 *    This file is part of VineaToum.
 *
 *    VineaToum is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    VineaToum is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with VineaToum.  If not, see <http://www.gnu.org/licenses/>.
 *    
 */

package org.vineatoum.business.state;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Vector;

import org.vineatoum.business.state.abstraction.VinAbstract;
import org.vineatoum.view.utils.jtablecustom.TableListener;

public class Marc extends VinAbstract {
	public static Set<Marc> marcs = new HashSet<Marc>();

	Map<Benne, Integer> bennes = new HashMap<Benne, Integer>();

	public Marc() {
		super();
		marcs.add(this);
		// TODO Auto-generated constructor stub
	}

	public void addBenne(Benne benne) {
		bennes.put(benne, 100);
		addNewOrigines(benne);
		benne.addNewFils(this);
	}

	public void addBenne(Benne benne, int pourcentage) {
		bennes.put(benne, pourcentage);
		addNewOrigines(benne);
		benne.addNewFils(this);
	}

	public Mout pressurage() {

		Mout mout = new Mout();
//		mout.setMarc(this);
		addNewFils(mout);
		return mout;
	}

	@Override
	public String toString() {
		String out = "---- Marc issu de " + origines.size()
				+ " bennes différentes" + "\n";
		return out;
	}

	@Override
	public TableListener getNewInstance() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Vector<String> getVectorColumns() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Vector<Object> getVectorData() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void updateField(String field, Object value) {
		// TODO Auto-generated method stub
		
	}

}
